Socket
Socket
Sign inDemoInstall

@types/mime

Package Overview
Dependencies
Maintainers
1
Versions
27
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@types/mime

TypeScript definitions for mime


Version published
Weekly downloads
22M
decreased by-10.83%
Maintainers
1
Weekly downloads
 
Created

What is @types/mime?

The @types/mime package contains TypeScript type definitions for the 'mime' package, which is a utility to work with MIME types. It allows TypeScript developers to use the 'mime' package with type safety, providing autocompletion and type checking during development.

What are @types/mime's main functionalities?

Lookup MIME type for a file extension

This feature allows you to get the MIME type for a given file extension. The getType function takes a file extension as a string and returns the corresponding MIME type.

"import mime from 'mime';

const mimeType = mime.getType('json'); // 'application/json'"

Get file extension for a MIME type

This feature allows you to get the file extension associated with a given MIME type. The getExtension function takes a MIME type as a string and returns the corresponding file extension.

"import mime from 'mime';

const extension = mime.getExtension('application/json'); // 'json'"

Other packages similar to @types/mime

FAQs

Package last updated on 07 Nov 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc